package com.ruoyi.slope.device.log.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.device.log.mapper.SlopeDeviceLogMapper;
import com.ruoyi.slope.device.log.domain.SlopeDeviceLog;
import com.ruoyi.slope.device.log.service.ISlopeDeviceLogService;

/**
 * 连接日志Service业务层处理
 * 
 * @author psy
 * @date 2025-05-01
 */
@Service
public class SlopeDeviceLogServiceImpl implements ISlopeDeviceLogService 
{
    @Autowired
    private SlopeDeviceLogMapper slopeDeviceLogMapper;

    /**
     * 查询连接日志
     * 
     * @param id 连接日志主键
     * @return 连接日志
     */
    @Override
    public SlopeDeviceLog selectSlopeDeviceLogById(Long id)
    {
        return slopeDeviceLogMapper.selectSlopeDeviceLogById(id);
    }

    /**
     * 查询连接日志列表
     * 
     * @param slopeDeviceLog 连接日志
     * @return 连接日志
     */
    @DataScope(deptAlias = "s")
    @Override
    public List<SlopeDeviceLog> selectSlopeDeviceLogList(SlopeDeviceLog slopeDeviceLog)
    {
        return slopeDeviceLogMapper.selectSlopeDeviceLogList(slopeDeviceLog);
    }

    /**
     * 新增连接日志
     * 
     * @param slopeDeviceLog 连接日志
     * @return 结果
     */
    @Override
    public int insertSlopeDeviceLog(SlopeDeviceLog slopeDeviceLog)
    {
        return slopeDeviceLogMapper.insertSlopeDeviceLog(slopeDeviceLog);
    }

    /**
     * 修改连接日志
     * 
     * @param slopeDeviceLog 连接日志
     * @return 结果
     */
    @Override
    public int updateSlopeDeviceLog(SlopeDeviceLog slopeDeviceLog)
    {
        slopeDeviceLog.setUpdateTime(DateUtils.getNowDate());
        return slopeDeviceLogMapper.updateSlopeDeviceLog(slopeDeviceLog);
    }

    /**
     * 批量删除连接日志
     * 
     * @param ids 需要删除的连接日志主键
     * @return 结果
     */
    @Override
    public int deleteSlopeDeviceLogByIds(Long[] ids)
    {
        return slopeDeviceLogMapper.deleteSlopeDeviceLogByIds(ids);
    }

    /**
     * 删除连接日志信息
     * 
     * @param id 连接日志主键
     * @return 结果
     */
    @Override
    public int deleteSlopeDeviceLogById(Long id)
    {
        return slopeDeviceLogMapper.deleteSlopeDeviceLogById(id);
    }
}
